.class public Lcom/wqmobile/sdk/protocol/n;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/wqmobile/sdk/protocol/m;


# static fields
.field private static d:Lcom/wqmobile/sdk/protocol/n;


# instance fields
.field private a:Ljava/util/List;

.field private b:Lcom/wqmobile/sdk/protocol/d;

.field private c:Lcom/wqmobile/sdk/protocol/o;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private constructor <init>(Lcom/wqmobile/sdk/protocol/d;)V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lcom/wqmobile/sdk/protocol/n;->b:Lcom/wqmobile/sdk/protocol/d;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    sget-object v0, Lcom/wqmobile/sdk/protocol/o;->a:Lcom/wqmobile/sdk/protocol/o;

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    return-void
.end method

.method public static a(Ljava/lang/String;Ljava/net/InetAddress;I)Lcom/wqmobile/sdk/protocol/b/a;
    .locals 2

    invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const-string v1, "udp"

    if-ne v0, v1, :cond_0

    invoke-static {p1, p2}, Lcom/wqmobile/sdk/protocol/b/c;->a(Ljava/net/InetAddress;I)Lcom/wqmobile/sdk/protocol/b/a;

    move-result-object v0

    :goto_0
    return-object v0

    :cond_0
    invoke-virtual {p0}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v0

    const-string v1, "tcp"

    if-ne v0, v1, :cond_1

    invoke-static {p1, p2}, Lcom/wqmobile/sdk/protocol/b/b;->a(Ljava/net/InetAddress;I)Lcom/wqmobile/sdk/protocol/b/a;

    move-result-object v0

    goto :goto_0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public static declared-synchronized a(Lcom/wqmobile/sdk/protocol/d;)Lcom/wqmobile/sdk/protocol/n;
    .locals 2

    const-class v0, Lcom/wqmobile/sdk/protocol/n;

    monitor-enter v0

    :try_start_0
    sget-object v1, Lcom/wqmobile/sdk/protocol/n;->d:Lcom/wqmobile/sdk/protocol/n;

    if-nez v1, :cond_1

    new-instance v1, Lcom/wqmobile/sdk/protocol/n;

    invoke-direct {v1, p0}, Lcom/wqmobile/sdk/protocol/n;-><init>(Lcom/wqmobile/sdk/protocol/d;)V

    sput-object v1, Lcom/wqmobile/sdk/protocol/n;->d:Lcom/wqmobile/sdk/protocol/n;

    :cond_0
    :goto_0
    invoke-static {}, Lcom/wqmobile/sdk/protocol/k;->a()Lcom/wqmobile/sdk/protocol/k;

    sget-object v1, Lcom/wqmobile/sdk/protocol/n;->d:Lcom/wqmobile/sdk/protocol/n;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-object v1

    :cond_1
    if-eqz p0, :cond_0

    :try_start_1
    sget-object v1, Lcom/wqmobile/sdk/protocol/n;->d:Lcom/wqmobile/sdk/protocol/n;

    iput-object p0, v1, Lcom/wqmobile/sdk/protocol/n;->b:Lcom/wqmobile/sdk/protocol/d;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

.method private a()V
    .locals 5

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->c()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    sget-object v0, Lcom/wqmobile/sdk/protocol/o;->b:Lcom/wqmobile/sdk/protocol/o;

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    invoke-static {}, Lcom/wqmobile/sdk/protocol/k;->b()Landroid/os/Handler;

    move-result-object v1

    invoke-virtual {v1}, Landroid/os/Handler;->obtainMessage()Landroid/os/Message;

    move-result-object v2

    new-instance v3, Lcom/wqmobile/sdk/protocol/j;

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    const/4 v4, 0x0

    invoke-interface {v0, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->a()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v3, p0, v0}, Lcom/wqmobile/sdk/protocol/j;-><init>(Lcom/wqmobile/sdk/protocol/m;Ljava/lang/String;)V

    iput-object v3, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    invoke-virtual {v1, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0
.end method

.method private b()V
    .locals 2

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_0

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;

    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->a()V

    :goto_0
    return-void

    :cond_0
    sget-object v0, Lcom/wqmobile/sdk/protocol/o;->a:Lcom/wqmobile/sdk/protocol/o;

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    goto :goto_0
.end method

.method private c()Z
    .locals 2

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    sget-object v1, Lcom/wqmobile/sdk/protocol/o;->a:Lcom/wqmobile/sdk/protocol/o;

    if-ne v0, v1, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method


# virtual methods
.method public final a(Lcom/wqmobile/sdk/protocol/p;)V
    .locals 1

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->c()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->a()V

    :cond_0
    return-void
.end method

.method public final a(Ljava/lang/String;)V
    .locals 3

    const/4 v2, 0x0

    sget-object v0, Lcom/wqmobile/sdk/protocol/o;->a:Lcom/wqmobile/sdk/protocol/o;

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->a()Ljava/lang/String;

    move-result-object v0

    if-ne v0, p1, :cond_0

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    sget-object v1, Lcom/wqmobile/sdk/protocol/a/b;->c:Lcom/wqmobile/sdk/protocol/a/b;

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/protocol/a/a;->a(Lcom/wqmobile/sdk/protocol/a/b;)V

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    invoke-virtual {v0, v2}, Lcom/wqmobile/sdk/protocol/a/a;->a(Z)V

    iget-object v1, p0, Lcom/wqmobile/sdk/protocol/n;->b:Lcom/wqmobile/sdk/protocol/d;

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    invoke-virtual {v1, v0}, Lcom/wqmobile/sdk/protocol/d;->a(Lcom/wqmobile/sdk/protocol/a/a;)V

    :cond_0
    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->b()V

    return-void
.end method

.method public final a([BLjava/lang/String;)V
    .locals 4

    const/4 v3, 0x0

    sget-object v0, Lcom/wqmobile/sdk/protocol/o;->a:Lcom/wqmobile/sdk/protocol/o;

    iput-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->c:Lcom/wqmobile/sdk/protocol/o;

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->a()Ljava/lang/String;

    move-result-object v0

    if-ne v0, p2, :cond_0

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    sget-object v1, Lcom/wqmobile/sdk/protocol/a/b;->c:Lcom/wqmobile/sdk/protocol/a/b;

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/protocol/a/a;->a(Lcom/wqmobile/sdk/protocol/a/b;)V

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/wqmobile/sdk/protocol/a/a;->a([B)V

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    sget-object v1, Lcom/wqmobile/sdk/protocol/a/b;->e:Lcom/wqmobile/sdk/protocol/a/b;

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/protocol/a/a;->a(Lcom/wqmobile/sdk/protocol/a/b;)V

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/wqmobile/sdk/protocol/a/a;->a(Z)V

    invoke-static {}, Lcom/wqmobile/sdk/protocol/q;->a()Lcom/wqmobile/sdk/protocol/q;

    move-result-object v1

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->b:Lcom/wqmobile/sdk/protocol/d;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/d;->n()Landroid/content/Context;

    move-result-object v2

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/a/a;->b()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v2, v0, p1}, Lcom/wqmobile/sdk/protocol/q;->a(Landroid/content/Context;Ljava/lang/String;[B)V

    iget-object v1, p0, Lcom/wqmobile/sdk/protocol/n;->b:Lcom/wqmobile/sdk/protocol/d;

    iget-object v0, p0, Lcom/wqmobile/sdk/protocol/n;->a:Ljava/util/List;

    invoke-interface {v0, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/wqmobile/sdk/protocol/p;

    invoke-virtual {v0}, Lcom/wqmobile/sdk/protocol/p;->b()Lcom/wqmobile/sdk/protocol/a/a;

    move-result-object v0

    invoke-virtual {v1, v0}, Lcom/wqmobile/sdk/protocol/d;->a(Lcom/wqmobile/sdk/protocol/a/a;)V

    :cond_0
    invoke-direct {p0}, Lcom/wqmobile/sdk/protocol/n;->b()V

    return-void
.end method
